#include<bits/stdc++.h>
using namespace std;
char Stack[9];
int main(){
    int x;
    int top = -1;
    cin >> x;
    int flag = 0;
    for(int j = x ;j/16;){
        j /=16;
        flag++;
    }
    for (int i = 0; i <= flag; i++)
    {
        int temp = (x >> 4*i) % 16;
        Stack[++top] = temp >= 0&&temp <= 9 ? temp +'0':temp -10 +'A';
    }
    while(top >= 0){
        putchar(Stack[top--]);
    }
    return 0;
}
